package com.cmw.service.impl;

import com.cmw.core.base.exception.ServiceException;
import com.cmw.core.ssm.dao.GenericDaoInter;
import com.cmw.core.ssm.service.AbsService;
import com.cmw.dao.StudentDao;
import com.cmw.entity.Student;
import com.cmw.service.inter.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 学生Service
 * @author Administrator
 *
 */
@Service("studentService")
public class StudentServiceImpl extends AbsService<Student, Long> implements StudentService {

	@Autowired
	public StudentDao studentDao;

	@Override
	public GenericDaoInter<Student, Long> getDao() {
		return studentDao;
	}


	@Override
	@Cacheable(value = "students_key")
	public List<Student> getListAll() throws ServiceException {
		List<Student> list = super.getListAll();
		System.out.println("若下面没出现“无缓存的时候调用”字样且能打印出数据表示测试成功");
		return list;
	}
}
